package cn.zktr.Personnel.model.pojos;

import java.io.Serializable;
import javax.persistence.*;
import java.sql.Timestamp;
import java.util.List;


/**
 * The persistent class for the per_pms_y_bun database table.
 * 
 */
@Entity
@Table(name="per_pms_y_bun")
@NamedQuery(name="PerPmsYBun.findAll", query="SELECT p FROM PerPmsYBun p")
public class PerPmsYBun implements Serializable {
	private static final long serialVersionUID = 1L;

	@Id
	private int bunid;

	private int bunber;

	private String bunname;

	private Timestamp buntime;

	//bi-directional many-to-one association to PerPmsDept
	@ManyToOne
	@JoinColumn(name="DEPTID")
	private PerPmsDept perPmsDept;

	//bi-directional many-to-one association to PerPmsEmp
	@ManyToOne
	@JoinColumn(name="EMPID")
	private PerPmsEmp perPmsEmp;

	//bi-directional many-to-one association to PerPmsYYtyp
	@ManyToOne
	@JoinColumn(name="YTYPID")
	private PerPmsYYtyp perPmsYYtyp;

	//bi-directional many-to-one association to PerPmsYYwxq
	@OneToMany(mappedBy="perPmsYBun")
	private List<PerPmsYYwxq> perPmsYYwxqs;

	public PerPmsYBun() {
	}

	public int getBunid() {
		return this.bunid;
	}

	public void setBunid(int bunid) {
		this.bunid = bunid;
	}

	public int getBunber() {
		return this.bunber;
	}

	public void setBunber(int bunber) {
		this.bunber = bunber;
	}

	public String getBunname() {
		return this.bunname;
	}

	public void setBunname(String bunname) {
		this.bunname = bunname;
	}

	public Timestamp getBuntime() {
		return this.buntime;
	}

	public void setBuntime(Timestamp buntime) {
		this.buntime = buntime;
	}

	public PerPmsDept getPerPmsDept() {
		return this.perPmsDept;
	}

	public void setPerPmsDept(PerPmsDept perPmsDept) {
		this.perPmsDept = perPmsDept;
	}

	public PerPmsEmp getPerPmsEmp() {
		return this.perPmsEmp;
	}

	public void setPerPmsEmp(PerPmsEmp perPmsEmp) {
		this.perPmsEmp = perPmsEmp;
	}

	public PerPmsYYtyp getPerPmsYYtyp() {
		return this.perPmsYYtyp;
	}

	public void setPerPmsYYtyp(PerPmsYYtyp perPmsYYtyp) {
		this.perPmsYYtyp = perPmsYYtyp;
	}

	public List<PerPmsYYwxq> getPerPmsYYwxqs() {
		return this.perPmsYYwxqs;
	}

	public void setPerPmsYYwxqs(List<PerPmsYYwxq> perPmsYYwxqs) {
		this.perPmsYYwxqs = perPmsYYwxqs;
	}

	public PerPmsYYwxq addPerPmsYYwxq(PerPmsYYwxq perPmsYYwxq) {
		getPerPmsYYwxqs().add(perPmsYYwxq);
		perPmsYYwxq.setPerPmsYBun(this);

		return perPmsYYwxq;
	}

	public PerPmsYYwxq removePerPmsYYwxq(PerPmsYYwxq perPmsYYwxq) {
		getPerPmsYYwxqs().remove(perPmsYYwxq);
		perPmsYYwxq.setPerPmsYBun(null);

		return perPmsYYwxq;
	}

}